<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
<% gcp_kube_cluster_name = "#{external_attribute(pwd, 'gcp_kube_cluster_name', doc_generation)}" -%>
<% gcp_kube_cluster_zone = "#{external_attribute(pwd, 'gcp_kube_cluster_zone', doc_generation)}" -%>
<% gcp_kube_cluster_size = "#{external_attribute(pwd, 'gcp_kube_cluster_size', doc_generation)}" -%>
<% gcp_kube_cluster_zone_extra1 = "#{external_attribute(pwd, 'gcp_kube_cluster_zone_extra1', doc_generation)}" -%>
<% gcp_kube_cluster_zone_extra2 = "#{external_attribute(pwd, 'gcp_kube_cluster_zone_extra2', doc_generation)}" -%>
<% gcp_kube_cluster_master_user = "#{external_attribute(pwd, 'gcp_kube_cluster_master_user', doc_generation)}" -%>
describe google_container_cluster(project: <%= gcp_project_id -%>, location: <%= gcp_kube_cluster_zone -%>, name: <%= gcp_kube_cluster_name -%>) do
  it { should exist }
  its('locations.sort'){ should cmp [ <%= gcp_kube_cluster_zone -%>, <%= gcp_kube_cluster_zone_extra1 -%>, <%= gcp_kube_cluster_zone_extra2 -%> ].sort }

  its('master_auth.username') { should eq <%= gcp_kube_cluster_master_user -%> }
end

describe google_container_cluster(project: <%= gcp_project_id -%>, location: <%= gcp_kube_cluster_zone -%>, name: 'nonexistent') do
  it { should_not exist }
end

describe google_container_cluster(project: <%= gcp_project_id -%>, location: <%= gcp_kube_cluster_zone -%>, name: <%= gcp_kube_cluster_name -%>, beta: true) do
  it { should exist }
  its('release_channel.channel') { should cmp "RAPID" }
end